package com.baiyun.yunpan.controller;


import com.baiyun.yunpan.entity.Report;
import com.baiyun.yunpan.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Sam
 * @date 2021/6/2 19:19
 */
@RestController
@RequestMapping("report")
@CrossOrigin(origins = "*", maxAge = 3600)
public class ReportController {
    @Autowired
    private ReportService reportService;

    @GetMapping("/add")
    public void add(Report report){
        reportService.add(report);
    }

    @GetMapping("/list")
    public Object list( ){
        return reportService.list();
    }

    @GetMapping("/delete")
    public void delete(int id){
        reportService.delete(id);
    }
}
